<tr>
  <td {{IF [[set.getVal('sumProgress')]] < [[set.getVal('keyspace')]]}}rel="popover" data-img="api/taskimg.php?task=[[set.getVal('taskId')]]&x=1200&y=6"{{ENDIF}} {{IF [[set.getVal('hasColor')]]}}style="background-color: #[[set.getVal('color')]]"{{ENDIF}}>
    <a href="tasks.php?id=[[set.getVal('taskId')]]">[[set.getVal('taskId')]]</a>
  </td>
  <td title="[[htmlentities([[set.getVal('attackCmd')]], ENT_QUOTES, 'UTF-8')]]">
    <a href="tasks.php?id=[[set.getVal('taskId')]]">[[set.getVal('taskName')]]</a>
    [[Util::tickdone([[set.getVal('sumProgress')]], [[set.getVal('keyspace')]])]]
    {{IF [[set.getVal('fileSecret')]]}}
      <span class="fas fa-lock" aria-hidden="true"></span>
    {{ENDIF}}
    {{IF [[set.getVal('isActive')]]}}
      <i class="fas fa-spinner fa-spin"></i>
    {{ENDIF}}
    {{IF [[set.getVal('isCpu')]] == 1}}
      <br>CPU only
    {{ENDIF}}
    {{IF [[set.getVal('isSmall')]] == 1}}
      <br>Small Task
    {{ENDIF}}
    {{IF [[set.getVal('isPrince')]] == 1}}
      <br>PRINCE
    {{ENDIF}}
  </td>
  <td>
    {{IF [[accessControl.hasPermission([[$DAccessControl::VIEW_HASHLIST_ACCESS]])]]}}
      <a href="hashlists.php?id=[[set.getVal('hashlistId')]]">[[set.getVal('hashlistName')]]</a>
    {{ELSE}}
      [[set.getVal('hashlistName')]]
    {{ENDIF}}
    {{IF [[set.getVal('isSecret')]] == 1}}
      <span class="fas fa-lock" aria-hidden="true"></span>
    {{ENDIF}}
    {{IF [[set.getVal('hashCount')]] == [[set.getVal('hashlistCracked')]]}}
      [[Util::tickdone(1, 1)]]
    {{ELSE}}
      [[Util::tickdone(0, 1)]]
    {{ENDIF}}
  </td>
  {{IF [[set.getVal('keyspace')]] > 0}}
    <td class='num'>
      [[Util::showperc([[set.getVal('taskProgress')]], [[set.getVal('keyspace')]])]]%
      / [[Util::showperc([[set.getVal('sumProgress')]], [[set.getVal('keyspace')]])]]%
    </td>
  {{ELSE}}
    <td>&nbsp;</td>
  {{ENDIF}}
  <td class='num' data-sort="[[set.getVal('crackedCount')]]">
    {{IF [[set.getVal('crackedCount')]] > 0 && [[accessControl.hasPermission([[$DAccessControl::VIEW_HASHES_ACCESS]])]]}}
      <a href="hashes.php?task=[[set.getVal('taskId')]]&filter=cracked">[[set.getVal('crackedCount')]] {{IF [[config.getVal([[$DConfig::SHOW_TASK_PERFORMANCE]])]] == 1}}([[set.getVal('performance')]]c/m){{ENDIF}}</a>
    {{ENDIF}}
    {{IF [[set.getVal('crackedCount')]] > 0 && ![[accessControl.hasPermission([[$DAccessControl::VIEW_HASHES_ACCESS]])]]}}
      [[set.getVal('crackedCount')]] {{IF [[config.getVal([[$DConfig::SHOW_TASK_PERFORMANCE]])]] == 1}}([[set.getVal('performance')]]c/m){{ENDIF}}
    {{ENDIF}}
  </td>
  <td class='num'>
    {{IF [[set.getVal('numAssignments')]] > 0}}
      [[set.getVal('numAssignments')]]{{IF [[set.getVal('isActive')]]}}<br>
        @[[Util::nicenum([[set.getVal('speed')]], 10000, 1000)]]H/s
      {{ENDIF}}
    {{ENDIF}}
  </td>
  <td style='min-width: 130px' data-sort="[[set.getVal('priority')]]">
    {{IF [[accessControl.hasPermission([[$DAccessControl::MANAGE_TASK_ACCESS]])]]}}
      <form class="form-inline" action="tasks.php" method="POST">
        <input type='hidden' name='action' value='[[$DTaskAction::SET_PRIORITY]]'>
        <input type="hidden" name="task" value="[[set.getVal('taskId')]]">
        <input type="hidden" name="csrf" value="[[csrf]]">
        <input type="text" class='form-control' style='width: 60px;' name="priority" size="4" value="[[set.getVal('priority')]]" title="Priority">
        <button type="submit" class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}} mx-1' data-toggle="tooltip" data-placement="top" title="Set Priority"><i class="fas fa-save" aria-hidden="true"></i></button>
      </form>
    {{ELSE}}
      [[set.getVal('priority')]]
    {{ENDIF}}
  </td>
  <td style='min-width: 130px' data-sort="[[set.getVal('maxAgents')]]">
    {{IF [[accessControl.hasPermission([[$DAccessControl::MANAGE_TASK_ACCESS]])]]}}
      <form class="form-inline" action="tasks.php" method="POST">
        <input type='hidden' name='action' value='[[$DTaskAction::SET_MAX_AGENTS]]'>
        <input type="hidden" name="task" value="[[set.getVal('taskId')]]">
        <input type="hidden" name="csrf" value="[[csrf]]">
        <input type="text" class='form-control' style='width: 60px;' name="maxAgents" size="4" value="[[set.getVal('maxAgents')]]" title="Max agents">
        <button type="submit" class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}} mx-1' data-toggle="tooltip" data-placement="top" title="Set max agents"><i class="fas fa-save" aria-hidden="true"></i></button>
      </form>
    {{ELSE}}
      [[set.getVal('maxAgents')]]
    {{ENDIF}}
  </td>
  <td style='min-width: 120px'>
    {{IF [[accessControl.hasPermission([[$DAccessControl::CREATE_TASK_ACCESS]])]]}}
      <form class="float-right mx-1" action="tasks.php" method="POST" onSubmit="if (!confirm('Really delete task [[set.getVal('taskId')]]?')) return false;">
        <input type="hidden" name="action" value="[[$DTaskAction::DELETE_TASK]]">
        <input type="hidden" name="task" value="[[set.getVal('taskId')]]">
        <input type="hidden" name="csrf" value="[[csrf]]">
        <button type="submit" class='btn btn-danger' data-toggle="tooltip" data-placement="top" title="Delete"><i class="fas fa-trash" aria-hidden="true"></i></button>
      </form>
      {{IF ![[showArchived]]}}
        <form class="float-right mx-1" action="tasks.php" method="POST" onSubmit="if (!confirm('Really archive task [[set.getVal('taskId')]]?')) return false;">
          <input type="hidden" name="action" value="[[$DTaskAction::ARCHIVE_TASK]]">
          <input type="hidden" name="task" value="[[set.getVal('taskId')]]">
          <input type="hidden" name="csrf" value="[[csrf]]">
          <button type="submit" class='btn btn-warning' data-toggle="tooltip" data-placement="top" title="Archive Task"><i class="fas fa-archive" aria-hidden="true"></i></button>
        </form>
      {{ENDIF}}
      <form class="float-right mx-1" action="tasks.php?new=true&copy=[[set.getVal('taskId')]]" method="post">
        <button type="submit" class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}}' data-toggle="tooltip" data-placement="top" title="Copy to Task"><i class="fas fa-copy" aria-hidden="true"></i></button>
      </form>
      {{IF [[accessControl.hasPermission([[$DAccessControl::CREATE_PRETASK_ACCESS]])]]}}
				<form class="float-right mx-1" action="pretasks.php?new=true&copyTask=[[set.getVal('taskId')]]" method="POST">
          <button type="submit" class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}}' data-toggle="tooltip" data-placement="top" title="Copy to Pretask"><i class="fas fa-bookmark" aria-hidden="true"></i></button>
				</form>
			{{ENDIF}}
    {{ENDIF}}
    
  </td>
</tr>
